package com.gxc.xor;

/**
 * Created by ASD on 2022/12/21.
 */
public class SelectOnlyOne {

    public static void main(String[] args) {
        int[] arr = new int[] {4,4,3,7,7,7,7};
        int i = addTime(arr);
        System.out.println(i);
    }

    private static int addTime(int[] arr) {
        int j = 0;
        for (int i = 0; i < arr.length; i++) {
            j ^= arr[i];
        }
        return j;
    }

}
